<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<?
require_once  '../classes/ConnectionDB.php';
require_once  '../classes/UtenteManager.php';
require_once  '../classes/TestDataManager.php';
require_once  '../classes/TestManager.php';
require_once  '../bean/Tests.php';
$connection =ConnectionDB::getInstance()->connectToDB();
$codiceStudente = $_GET['codiceStudente'];

$test = TestDataManager::getInstance()->getTestSottomessiByStudente($connection, $codiceStudente);



?>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Report test</title>
        <script src="../glassboxLatest/glassbox.2.0.0/javascripts/prototype.js" type="text/javascript"></script>
        <script src="../glassboxLatest/glassbox.2.0.0/javascripts/scriptaculous/effects.js" type="text/javascript"></script>
        <script src="../glassboxLatest/glassbox.2.0.0/javascripts/glassbox/glassbox.js" type="text/javascript"></script>
        <style type="text/css">
            @import url("../css/style.css");
            table{
                width: 100%;
            }

            #tableResults td{
                text-align: center;
            }


            #results {
                padding-top: 3%;
            }



        </style>
        <script type="text/javascript">
            path_to_root_dir = "../glassboxLatest/glassbox.2.0.0/";
            var listaDomande;
            var numItem=8;
            var currentIndex=0;

            window.onload = function()
            {
                var results = new GlassBox();
                results.init( 'results', '1040px', '390px', 'auto','',true,false);
                results.ipos();
                results.appear();


            }


        </script>
    </head>
    <body>

        <?php include '../portal/header.php';?>
        <center>

            <div id="results">
                <div id="resultsCont">
                    <table border='1' id='tableResults' cellpadding='5'>
                        <tr>
                            <th>Codice Test</th>
                            <th>Key generata</th>
                            <th>Data creazione</th>
                            <th>Nome</th>
                            <th>Tempo</th>
                            <th>Elenco Domande</th>
              
                            <th>Punteggio</th>
                            <th>Dettagli</th>
                        </tr>
                        <? for($j=0; $j<count($test); $j++)
                        {
                            $key = $test[$j]->getChiaveTest();
                            $stato = TestDataManager::getInstance()->getStatoTestByCodiceAndKey($connection, $test[$j]->getCodice(), $key);
                            $punteggio = TestManager::getInstance()->calcolaPunteggioStudentiTest($connection, $test[$j]->getCodice(), $codiceStudente, $key);

                            $testDetail = TestDataManager::getInstance()->getTestByCodice($connection, $test[$j]->getCodice());
                            ?>
                        <tr>
                            <td><?= $testDetail->getCodice() ?></td>
                            <td><?= $key ?></td>
                            <td><?= $testDetail->getDataCreazione() ?></td>
                            <td><?= $testDetail->getNome() ?></td>
                            <td><?= $testDetail->getOre() ?> hh : <?= $testDetail->getMinuti() ?> mm</td>
                            <td><a href="testQuestions.php?fromSottomessi=1&chiaveTest=<?= $key ?>&codiceTest=<?= $testDetail->getCodice() ?>"><img src='../images/icons/PNG/Document.png' height='30' width='30' title='Elenco domande' border='0'/></a></td>
                           
                            <td><?= $punteggio ?></td>
                            <td><a href='../testManaging/domandeRisultatiTest.php?codiceStudente=<?= $codiceStudente ?>&key=<?= $key?>&codiceTest=<?= $testDetail->getCodice() ?>'><img src='../images/icons/PNG/Magnifying Glass.png' height='30' width='30' title='Risultati' border='0'/></a></td>
                        </tr>
                            <?
                        }?>

                    </table>
                </div>

            </div>
        </center>
    </body>
</html>
